#ifndef __THREAD_H_
#define __THREAD_H_
#include <pthread.h>
class Scoped
{
	pthread_mutex_t *mx;
	public:
	~Scoped () { pthread_mutex_unlock(mx); }
	explicit Scoped(pthread_mutex_t& m) : mx(&m) { pthread_mutex_lock(mx); }
};

#endif
